using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._RasterAnalysisTools._UseProximity
{
    /// <summary>
    /// <para>Optimal Region Connections</para>
    /// <para>Calculates the optimal connection of paths between two or more input regions.</para>
    /// <para>计算两个或多个输入区域之间的路径的最佳连接。</para>
    /// </summary>    
    [DisplayName("Optimal Region Connections")]
    public class OptimalRegionConnections : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public OptimalRegionConnections()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_inputRegionRasterOrFeatures">
        /// <para>Input Region Raster or Features</para>
        /// <para><xdoc>
        ///   <para>The input regions to be connected by the optimal network.</para>
        ///   <para>Regions can be defined by either raster or feature data.</para>
        ///   <para>If the region input is raster, the regions are defined by groups of contiguous (adjacent) cells of the same value. Each region must be uniquely numbered. The cells that are not part of any region must be NoData. The raster type must be integer, and the values can be either positive or negative.</para>
        ///   <para>If the region input is feature data, it can be polygons, lines, or points. Polygon feature regions cannot be composed of multipart polygons.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要通过最优网络连接的输入区域。</para>
        ///   <para>区域可由栅格数据或要素数据定义。</para>
        ///   <para>如果区域输入为栅格，则区域由相同值的连续（相邻）像元组定义。每个区域必须具有唯一编号。不属于任何区域的单元格必须是 NoData。栅格类型必须为整数，并且值可以是正数或负数。</para>
        ///   <para>如果区域输入是要素数据，则可以是面、线或点。面要素区域不能由多部分面组成。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_outputOptimalLinesName">
        /// <para>Output Optimal Connectivity Lines Name</para>
        /// <para><xdoc>
        ///   <para>The name of the output line feature service that connects each input region.</para>
        ///   <para>Each path (or line) is uniquely numbered and additional fields in the attribute table store specific information about the path. Those additional fields are the following:</para>
        ///   <bulletList>
        ///     <bullet_item>PATHID—The unique identifier for the path</bullet_item><para/>
        ///     <bullet_item>PATHCOST—The total accumulative distance or cost for the path</bullet_item><para/>
        ///     <bullet_item>REGION1—The first region the path connects</bullet_item><para/>
        ///     <bullet_item>REGION2—The other region the path connects</bullet_item><para/>
        ///   </bulletList>
        ///   <para>This information provides insight into the paths within the network.</para>
        ///   <para>Since each path is represented by a unique line, there will be multiple lines in locations where paths travel the same route.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>连接每个输入区域的输出线要素服务的名称。</para>
        ///   <para>每条路径（或线）都有唯一的编号，属性表中的其他字段存储有关路径的特定信息。这些附加字段如下：</para>
        ///   <bulletList>
        ///     <bullet_item>PATHID - 路径的唯一标识符</bullet_item><para/>
        ///     <bullet_item>PATHCOST—路径的总累积距离或总成本</bullet_item><para/>
        ///     <bullet_item>REGION1 - 路径连接的第一个区域</bullet_item><para/>
        ///     <bullet_item>REGION2 - 路径连接的其他区域</bullet_item><para/>
        ///   </bulletList>
        ///   <para>此信息提供了对网络内路径的洞察。</para>
        ///   <para>由于每条路径都由一条唯一的线表示，因此在路径沿同一路线行驶的位置将有多条线。</para>
        /// </xdoc></para>
        /// </param>
        public OptimalRegionConnections(object _inputRegionRasterOrFeatures, object _outputOptimalLinesName)
        {
            this._inputRegionRasterOrFeatures = _inputRegionRasterOrFeatures;
            this._outputOptimalLinesName = _outputOptimalLinesName;
        }
        public override string ToolboxName => "Raster Analysis Tools";

        public override string ToolName => "Optimal Region Connections";

        public override string CallName => "ra.OptimalRegionConnections";

        public override List<string> AcceptEnvironments => ["cellSize", "extent", "mask", "outputCoordinateSystem", "snapRaster"];

        public override object[] ParameterInfo => [_inputRegionRasterOrFeatures, _outputOptimalLinesName, _inputBarrierRasterOrFeatures, _inputCostRaster, _outputNeighborConnectionsName, _distanceMethod.GetGPValue(), _connectionsWithinRegions.GetGPValue(), _outputOptimalLinesFeatures, _outputNeighborConnectionFeatures];

        /// <summary>
        /// <para>Input Region Raster or Features</para>
        /// <para><xdoc>
        ///   <para>The input regions to be connected by the optimal network.</para>
        ///   <para>Regions can be defined by either raster or feature data.</para>
        ///   <para>If the region input is raster, the regions are defined by groups of contiguous (adjacent) cells of the same value. Each region must be uniquely numbered. The cells that are not part of any region must be NoData. The raster type must be integer, and the values can be either positive or negative.</para>
        ///   <para>If the region input is feature data, it can be polygons, lines, or points. Polygon feature regions cannot be composed of multipart polygons.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要通过最优网络连接的输入区域。</para>
        ///   <para>区域可由栅格数据或要素数据定义。</para>
        ///   <para>如果区域输入为栅格，则区域由相同值的连续（相邻）像元组定义。每个区域必须具有唯一编号。不属于任何区域的单元格必须是 NoData。栅格类型必须为整数，并且值可以是正数或负数。</para>
        ///   <para>如果区域输入是要素数据，则可以是面、线或点。面要素区域不能由多部分面组成。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Region Raster or Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputRegionRasterOrFeatures { get; set; }


        /// <summary>
        /// <para>Output Optimal Connectivity Lines Name</para>
        /// <para><xdoc>
        ///   <para>The name of the output line feature service that connects each input region.</para>
        ///   <para>Each path (or line) is uniquely numbered and additional fields in the attribute table store specific information about the path. Those additional fields are the following:</para>
        ///   <bulletList>
        ///     <bullet_item>PATHID—The unique identifier for the path</bullet_item><para/>
        ///     <bullet_item>PATHCOST—The total accumulative distance or cost for the path</bullet_item><para/>
        ///     <bullet_item>REGION1—The first region the path connects</bullet_item><para/>
        ///     <bullet_item>REGION2—The other region the path connects</bullet_item><para/>
        ///   </bulletList>
        ///   <para>This information provides insight into the paths within the network.</para>
        ///   <para>Since each path is represented by a unique line, there will be multiple lines in locations where paths travel the same route.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>连接每个输入区域的输出线要素服务的名称。</para>
        ///   <para>每条路径（或线）都有唯一的编号，属性表中的其他字段存储有关路径的特定信息。这些附加字段如下：</para>
        ///   <bulletList>
        ///     <bullet_item>PATHID - 路径的唯一标识符</bullet_item><para/>
        ///     <bullet_item>PATHCOST—路径的总累积距离或总成本</bullet_item><para/>
        ///     <bullet_item>REGION1 - 路径连接的第一个区域</bullet_item><para/>
        ///     <bullet_item>REGION2 - 路径连接的其他区域</bullet_item><para/>
        ///   </bulletList>
        ///   <para>此信息提供了对网络内路径的洞察。</para>
        ///   <para>由于每条路径都由一条唯一的线表示，因此在路径沿同一路线行驶的位置将有多条线。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Optimal Connectivity Lines Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _outputOptimalLinesName { get; set; }


        /// <summary>
        /// <para>Input Barrier Raster or Features</para>
        /// <para><xdoc>
        ///   <para>The dataset that defines the barriers.</para>
        ///   <para>The barriers can be defined by an integer or a floating-point image service, or by a feature service.</para>
        ///   <para>For an image service barrier, the barrier must have a valid value, including zero, and the areas that are not barriers must be NoData.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>定义障碍的数据集。</para>
        ///   <para>障碍可以由整数或浮点影像服务或要素服务定义。</para>
        ///   <para>对于影像服务屏障，屏障必须具有有效值（包括零），并且非屏障的区域必须为 NoData。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Barrier Raster or Features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _inputBarrierRasterOrFeatures { get; set; } = null;


        /// <summary>
        /// <para>Input Cost Raster</para>
        /// <para><xdoc>
        ///   <para>An image service defining the impedance or cost to move planimetrically through each cell.</para>
        ///   <para>The value at each cell location represents the cost-per-unit distance for moving through the cell. Each cell location value is multiplied by the cell resolution while also compensating for diagonal movement to obtain the total cost of passing through the cell.</para>
        ///   <para>The values of the cost raster can be integer or floating point, but they cannot be negative or zero (you cannot have a negative or zero cost).</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>一种影像服务，用于定义在每个单元中平面移动的阻抗或成本。</para>
        ///   <para>每个像元位置的值表示在像元中移动的单位距离成本。每个像元位置值乘以像元分辨率，同时还补偿对角线移动，以获得通过像元的总成本。</para>
        ///   <para>成本栅格的值可以是整数或浮点，但不能为负数或零（不能为负数或零成本）。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Cost Raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _inputCostRaster { get; set; } = null;


        /// <summary>
        /// <para>Output Neighboring Connections Name</para>
        /// <para><xdoc>
        ///   <para>The output polyline feature class identifying all paths from each region to each of its closest or cost neighbors.</para>
        ///   <para>Each path (or line) is uniquely numbered and additional fields in the attribute table store specific information about the path. Those additional fields are the following:</para>
        ///   <bulletList>
        ///     <bullet_item>PATHID—The unique identifier for the path</bullet_item><para/>
        ///     <bullet_item>PATHCOST—The total accumulative distance or cost for the path</bullet_item><para/>
        ///     <bullet_item>REGION1—The first region the path connects</bullet_item><para/>
        ///     <bullet_item>REGION2—The other region the path connects</bullet_item><para/>
        ///   </bulletList>
        ///   <para>This information provides insight into the paths within the network and is useful when deciding which paths should be removed if necessary.</para>
        ///   <para>Since each path is represented by a unique line, there will be multiple lines in locations where paths travel the same route.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出折线要素类，用于标识从每个区域到其每个最近邻域或成本邻域的所有路径。</para>
        ///   <para>每条路径（或线）都有唯一的编号，属性表中的其他字段存储有关路径的特定信息。这些附加字段如下：</para>
        ///   <bulletList>
        ///     <bullet_item>PATHID - 路径的唯一标识符</bullet_item><para/>
        ///     <bullet_item>PATHCOST—路径的总累积距离或总成本</bullet_item><para/>
        ///     <bullet_item>REGION1 - 路径连接的第一个区域</bullet_item><para/>
        ///     <bullet_item>REGION2 - 路径连接的其他区域</bullet_item><para/>
        ///   </bulletList>
        ///   <para>此信息提供了对网络内路径的洞察，并且在决定在必要时应删除哪些路径时非常有用。</para>
        ///   <para>由于每条路径都由一条唯一的线表示，因此在路径沿同一路线行驶的位置将有多条线。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Neighboring Connections Name")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _outputNeighborConnectionsName { get; set; } = null;


        /// <summary>
        /// <para>Distance Method</para>
        /// <para><xdoc>
        ///   <para>Specifies whether to calculate the distance using a planar (flat earth) or a geodesic (ellipsoid) method.</para>
        ///   <bulletList>
        ///     <bullet_item>Planar—The distance calculation will be performed on a projected flat plane using a 2D Cartesian coordinate system. This is the default.</bullet_item><para/>
        ///     <bullet_item>Geodesic—The distance calculation will be performed on the ellipsoid. Therefore, regardless of input or output projection, the results do not change.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是使用平面（平坦地球）还是测地线（椭球体）方法计算距离。</para>
        ///   <bulletList>
        ///     <bullet_item>平面—将使用 2D 笛卡尔坐标系在投影平面上执行距离计算。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>测地线—将在椭球体上执行距离计算。因此，无论输入或输出投影如何，结果都不会改变。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _distanceMethod_value _distanceMethod { get; set; } = _distanceMethod_value._PLANAR;

        public enum _distanceMethod_value
        {
            /// <summary>
            /// <para>Planar</para>
            /// <para>Planar—The distance calculation will be performed on a projected flat plane using a 2D Cartesian coordinate system. This is the default.</para>
            /// <para>平面—将使用 2D 笛卡尔坐标系在投影平面上执行距离计算。这是默认设置。</para>
            /// </summary>
            [Description("Planar")]
            [GPEnumValue("PLANAR")]
            _PLANAR,

            /// <summary>
            /// <para>Geodesic</para>
            /// <para>Geodesic—The distance calculation will be performed on the ellipsoid. Therefore, regardless of input or output projection, the results do not change.</para>
            /// <para>测地线—将在椭球体上执行距离计算。因此，无论输入或输出投影如何，结果都不会改变。</para>
            /// </summary>
            [Description("Geodesic")]
            [GPEnumValue("GEODESIC")]
            _GEODESIC,

        }

        /// <summary>
        /// <para>Connections Within Regions</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the paths will continue and connect within the input regions.</para>
        ///   <bulletList>
        ///     <bullet_item>Generate connections—Paths will continue within the input regions to connect all paths that enter a region.</bullet_item><para/>
        ///     <bullet_item>No connections—Paths will stop at the edges of the input regions and will not continue or connect within them.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定路径是否将继续并在输入区域内连接。</para>
        ///   <bulletList>
        ///     <bullet_item>生成连接 - 路径将在输入区域内继续，以连接进入区域的所有路径。</bullet_item><para/>
        ///     <bullet_item>无连接 - 路径将停止在输入区域的边缘，并且不会在输入区域内继续或连接。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Connections Within Regions")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _connectionsWithinRegions_value _connectionsWithinRegions { get; set; } = _connectionsWithinRegions_value._GENERATE_CONNECTIONS;

        public enum _connectionsWithinRegions_value
        {
            /// <summary>
            /// <para>Generate connections</para>
            /// <para>Generate connections—Paths will continue within the input regions to connect all paths that enter a region.</para>
            /// <para>生成连接 - 路径将在输入区域内继续，以连接进入区域的所有路径。</para>
            /// </summary>
            [Description("Generate connections")]
            [GPEnumValue("GENERATE_CONNECTIONS")]
            _GENERATE_CONNECTIONS,

            /// <summary>
            /// <para>No connections</para>
            /// <para>No connections—Paths will stop at the edges of the input regions and will not continue or connect within them.</para>
            /// <para>无连接 - 路径将停止在输入区域的边缘，并且不会在输入区域内继续或连接。</para>
            /// </summary>
            [Description("No connections")]
            [GPEnumValue("NO_CONNECTIONS")]
            _NO_CONNECTIONS,

        }

        /// <summary>
        /// <para>Output optimal connectivity lines</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output optimal connectivity lines")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _outputOptimalLinesFeatures { get; set; }


        /// <summary>
        /// <para>Output Neighboring Connections</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Neighboring Connections")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _outputNeighborConnectionFeatures { get; set; }


        public OptimalRegionConnections SetEnv(object cellSize = null, object extent = null, object mask = null, object outputCoordinateSystem = null, object snapRaster = null)
        {
            base.SetEnv(cellSize: cellSize, extent: extent, mask: mask, outputCoordinateSystem: outputCoordinateSystem, snapRaster: snapRaster);
            return this;
        }

    }

}